<%-- 
    Document   : listagemExames
    Created on : Nov 17, 2012, 12:48:53 PM
    Author     : Gattini
--%>

<%@page import="br.com.maternity.componentes.grid.PersonalGrid"%>
<%@page import="br.com.maternity.componentes.grid.PersonalGridStyle"%>
<%@page import="br.com.maternity.classes.dao.ExameDAO"%>
<%@page import="br.com.maternity.classes.entity.Exame"%>
<%@page import="java.util.List"%>
<%@page import="br.com.maternity.componentes.grid.PersonalGridColumn"%>
<%@page import="java.util.ArrayList"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:include page="../cabecalho.jsp"></jsp:include>
<div id="titulo">Relatorio de Exames</div>
<div id="painel">
    <%
    
        ArrayList<PersonalGridColumn> cols = new ArrayList<PersonalGridColumn>();
        PersonalGridColumn c = new PersonalGridColumn("Id", "getId", "");
        List<String> qsf = new ArrayList<String>();
        qsf.add("getId");
        c.setRedirectLink(request.getContextPath() + "/acoes/cadastroExame.jsp?id=@");
        c.setQueryStringFields(qsf);
        cols.add(c);
        

        c = new PersonalGridColumn("Exame", "getDescricao", "");
        c.setWidth(80);
        c.setRedirectLink(request.getContextPath() + "/acoes/cadastroExame.jsp?id=@");
        c.setQueryStringFields(qsf);
        cols.add(c);

        PersonalGridStyle rs = new PersonalGridStyle();

        ExameDAO dao = new ExameDAO();

        List<Exame> source = dao.selectAll();

        PersonalGrid g = new PersonalGrid("exame", "exame", new ArrayList<Object>(source), cols, rs);
    %>
    <%=g.render(null)%>
</div>
<br />
<a class="botao" href="../acoes/cadastroExame.jsp">Novo Exame</a>
<jsp:include page="../rodape.jsp"></jsp:include>
